/*
 * GeoVISTA Center (Penn State, Dept. of Geography)
 * Copyright (c) 2002, GeoVISTA Center
 * Licensed under Simplified BSD License
 * This library is developed and distributed for free usage,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * You can redistribute and/or modify it under the terms of the
 * Simplified BSD License
 *
 *
 *
 *
 *
 *
 *
 * @original author: jin Chen 
 * @author: jin Chen 
 * @date: Nov 11, 2007$
 * @version: 1.0
 */
package edu.psu.geovista.app.vit.pub.components.sts;

import java.util.Set;

public class SpatialClusterInfo {
    public ClusterID id;//session id + cluster id
   // double observed;
  //  double expected;
   //SaTScan raw info
   public  double  ode;//     observed/expected;
   public double rrisk;// relative risk
   public double pvalue;
   public double latitude;
   public double longitude;
   public double radius;
   public double circuleSize; // maximum-size: the populaton size of SaTScan that generate this cluster
   public  Set memberIds;// id of data item belonging to the cluster
   //calcualted info
   public double variance4ode;  //standard deviation of ode
   public double pctLowOde;  //// 
   public double pctHighOde;  //// 
   public long population;       //population belong to this cluster
   public double pop_percentage;  //percentage of population belong to this cluster
   public double reliability; //  
    public SpatialClusterInfo(Object sessionId,Object Id) {
        this.id = new ClusterID(sessionId,Id);
    }

    /*   public double getODE(){
            return observed/expected;
        }
    */
    public static class ClusterID{
        Object sessionId; //id
        Object Id;// id within a session. Usually a integer

        public ClusterID(Object sessionId, Object id) {
            this.sessionId = sessionId;
            Id = id;
        }

        public String toString(){
            return sessionId+"_Cluster"+Id;
        }
        public int hashCode(){
            return toString().hashCode();


        }
     public boolean equals(Object obj) {
         ClusterID another= (ClusterID) obj;
         return  toString().equals(another.toString());
     }
    }

}

